#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    Point(){
        cout << "Point()" << endl;
    }

    //初始化列表的形式
    //在构造函数参数列表后，函数体之前
    //以:开头，多个数据成员的初始化以，隔开
    //推荐每个数据成员的初始化独占一行
    Point(int x,int y)
    : _ix(x)
    , _iy(y)
    {
        cout <<"Point(int,int)" << endl;
    }

    Point(int x,int y,int z){
        _ix = x;
        _iy = y + z;
        cout << "Point(int,int,int)" << endl;
    }
    void print(){
        cout << "(" << _ix << ","
            << _iy << ")" << endl;
    }
private:
    int _ix;
    int _iy;
};

void test0(){
    Point pt(2,3);
    pt.print();

}

int main(void){
    test0();
    return 0;
}
